SetGfxDriver 1:Graphics 1024,768,8,2 :SetBuffer FrontBuffer() ;:SeedRnd MilliSecs()
Global spub
Include "fn.bb"
spub= Str "error"
While Not KeyHit(1) Or MouseHit(2)
ClsColor 0,0,0
Cls

x1=Rand(0,255):x2=Rand(0,255):x3=Rand(0,255):x4=Rand(0,255)
y1=x1 Xor x2
y2 = x2 Xor x3
y3 = x3 Xor x4
y4 = x4 Xor x1

Text 2,2,""+x1+" "+x2+" "+x3+" "+x4,False ,False
Text 2,12,""+y1+" "+y2+" "+y3+" "+y4,False ,False


For i1=0 To 255
For i4=0 To 255
If (i4 Xor i1) = y4  Then 
	For i3=0 To 255
		For i2=0 To 255
		  If  (y1=(i1 Xor i2)) And (y2 = (i2 Xor i3)) And ((i3 Xor i4)=y3) And ((i4 Xor i1) = y4) And (i1 <2) Then z2=z2+1 
		Next
	Next	
EndIf 
Next
Next

Text 2,22,""+z1+" "+z2+" "+z3+" "+z4,False ,False


zzz1=zzz1+1

Flip
If zzz1> 0 Then  MouseWait(): randnum(1)
VWait 
Wend 

Function erase()

End Function

Function fact_faza()

	For unittest=0 To 5	

		For i = 0 To 9 
		PokeInt in2,i*5,mod2(PeekInt (in1,i*5) - unittest^9)
		Next 
			
		eee=fact(fact(PeekInt(in2,0),PeekInt(in2,5),PeekInt(in2,10)),fact(PeekInt(in2,0+15),PeekInt(in2,5+15),PeekInt(in2,10+15)),fact(PeekInt(in2,0+2*15),PeekInt(in2,5+2*15),PeekInt(in2,10+2*15)))
		If (eee = unittest) Then zzz(zzz1)=zzz(zzz1)+1:zzz2(zzz1,zzz2(zzz1,100))=unittest:zzz2(zzz1,100)=zzz2(zzz1,100)+1
		If zzz2(zzz1,100)=0 Then zzz2(zzz1,99)=eee
	Next
		
		

End Function